package com.bdqn.wx.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bdqn.wx.dao.ImageDao;
import com.bdqn.wx.dao.impl.CommDaoImpl;
import com.bdqn.wx.entity.Comments;
import com.bdqn.wx.entity.Image;
import com.bdqn.wx.service.UserService;

@Service
//服务层的bean。
public class UserServiceImpl implements UserService {
	
	@Autowired
	private ImageDao imageDao;
	@Autowired
	private CommDaoImpl commdaoipml;
	
	@Override
	public Image getImg(Integer id) {
		return imageDao.getImage(id);
	}


	@Override
	public boolean saveComment(Comments comments) {
		
		try {
			commdaoipml.save(comments);
			
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
		
		    return true;
	}

}
